
from gobjects import GObject
from fonts    import regularFont




class Text(GObject):
    def __init__(self, x=0, y=0, z=0, text='', **kw):
        GObject.__init__(self, x, y, z, **kw)
        self.text = text

    def render(self):
        glPushMatrix()
        glTranslatef(*self.translation)
        glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, COLOR_WHITE)
        glColor4fv(self.color)
        self._render()
        glPopMatrix()

    def _render(self):
        regularFont.render(self.text)
        